package com.lsj.core.util;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.lsj.core.exception.CustomerException;
import com.lsj.core.response.ResponseType;

/**
 * @Author:lin.sj
 * @Data:2021/7/8 20:22
 * @Desc:
 */
public class ExceptionHelperUtil {
    //检查入参对象是否为空，抛出异常
    public static void nullObjException(Object obj,String msg){
        if(obj == null){
            throw new CustomerException(ResponseType.error,msg);
        }
        if(obj instanceof String && StringUtils.isBlank((String)obj)){
            throw new CustomerException(ResponseType.error,msg);
        }
    }
}
